package server.main.utils.mainutils;

import java.util.ArrayList;

public class OtherUtils {
    /**
     * Arraylist转换成list
     * @param arrayList
     * @return
     */
    public static String[] StringArrayList2List(ArrayList<String> arrayList){
        try {
            int size = arrayList.size();
            String[] array = (String[])arrayList.toArray(new String[size]);
//            for(int i=0;i<array.length;i++){
//                System.out.println(array[i]);
//            }
            return array;
        } catch (Exception e) {
            e.printStackTrace();
        }
        return null;
    }

    public static Integer[] IntegerArrayList2List(ArrayList<Integer> arrayList){
        try {
            int size = arrayList.size();
            Integer[] array = (Integer[])arrayList.toArray(new Integer[size]);
            return array;
        } catch (Exception e) {
            e.printStackTrace();
        }
        return null;
    }


}
